package cn.template.controllers;

import cn.template.models.common.JwtUser;
import cn.template.services.BaseService;
import org.springframework.security.core.context.SecurityContextHolder;

public abstract class BaseController<T extends BaseService> {
    protected T service;

    protected static JwtUser getUser() {
        return (JwtUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
